package multiThreading.producerConsumerSimple;

public class ProducerConsumer {

	public static void main(String[] args) {
		Buffer buf = new Buffer();
		System.out.println("ProducerConsumer.main()");
		Thread p = new  Thread (new Producer(buf));
		p.setName("first Producer");
		Thread c = new  Thread (new Consumer(buf));
		c.setName("first Consumer");
		
		Thread aP = new  Thread (new Producer(buf));
		aP.setName("Second Producer");
		Thread aC = new  Thread (new Consumer(buf));
		aC.setName("Second Consumer");
		
		
		p.start();
		c.start();
		

		aP.start();
		aC.start();
		
		
		try {
				p.join();
				c.join();
			} catch (InterruptedException e) {
				e.printStackTrace();
		}
	}

}
